--[[
Author: godguy
Function: load all *.lua in the given directory.
]]
local function LoadDirectory(dirname)
	local all_states = {}
	love.filesystem.getDirectoryItems(dirname, function(filename)
			local begin = string.find(filename, '.lua')
			if begin then
				local module_name = string.sub(filename, 0, begin - 1)
				print(module_name)
				local module = require(module_name)
				print(module)
				all_states[module_name] = module
			end
		end)
	return all_states
end
return LoadDirectory
